#!/bin/bash
# automatically remote login, also, it can be automatically execute command remotely
# 172.16.112.130 besh
# 172.16.9.72 fesh
# 172.16.27.7 node1
# 172.16.27.8 node2
# 172.16.27.9 node3
# 172.16.27.36 halo
# 47.102.124.89 hongren

case "$1" in
	besh)
		sshpass -f /home/witt/bak/shell/shpw ssh tdf@besh $2
		;;
	besh2)
		sshpass -f /home/witt/bak/shell/shpw ssh kingbase@besh $2
                ;;
        besh3)
                sshpass -f /home/witt/bak/shell/shpw2 ssh root@besh $2
                ;;
	fesh)
		sshpass -f /home/witt/bak/shell/shpw ssh root@fesh $2
		;;
        node1)
                sshpass -f /home/witt/bak/shell/shpw3 ssh root@node1 $2
                ;;
        node2)
                sshpass -f /home/witt/bak/shell/shpw3 ssh root@node2 $2
                ;;
        node3)
                sshpass -f /home/witt/bak/shell/shpw3 ssh root@node3 $2
                ;;
        halo)
                sshpass -f /home/witt/bak/shell/shpw_halo ssh root@halo $2
                ;;
	work)
                sshpass -f /home/witt/bak/shell/shpw_work ssh witt@work $2
                ;;

        bd)
                sshpass -f /home/witt/bak/shell/shpw3 ssh root@node1 $2
                sshpass -f /home/witt/bak/shell/shpw3 ssh root@node2 $2
                sshpass -f /home/witt/bak/shell/shpw3 ssh root@node3 $2
                ;;
	fse)
                ssh -i ~/bak/sshkey/thermoops-FSE-UAT-For-Guide thermoops@fse
		;;
	hongren)
		sshpass -f /home/witt/bak/shell/shpw-hr ssh root@47.102.124.89 $2
		;;

	*)
		echo "Usage: ssha {besh | besh2 | besh3 | fesh | node1 | node2 | node3 | halo | work | bd | fse | hongren} [\"command\"]"
		exit 1
		;;
esac

